feat: Support --date flag for tmpo log and tmpo stats#104
Merged
DylanDevelops merged 1 commit intomainfrom Mar 31, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
mainbranch of tmpo.Closes #91
Description
This pull request adds support for filtering history logs and statistics by a specific date in both the
logandstatscommands. It introduces a new--date(or-d) flag, allowing users to view entries or stats for a user-specified date. The implementation also includes logic to handle different date formats based on user configuration.New date filtering functionality:
--date(-d) flag to both thelogandstatscommands to allow filtering entries or statistics for a specific date (cmd/history/log.go,cmd/history/stats.go). [1] [2] [3] [4]Command logic updates:
logcommand to check for thelogDateflag and retrieve entries within the specified date range using the new flag (cmd/history/log.go).statscommand to check for thestatsDateflag and compute statistics for the specified date, displaying the date in a user-friendly format (cmd/history/stats.go).Date parsing improvements:
parseDateFlaghelper function to parse the date input according to the user's configured date format, with fallback and error messaging (cmd/history/log.go).These changes improve usability by allowing users to easily filter logs and stats by any date, not just today or this week.